//
//  AppController.h
//  VidCrusher
//
//  Created by Cemil Browne on 4/06/08.
//  Copyright 2008 Cemil Browne. All rights reserved.
//
/*
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */ 


#import <Cocoa/Cocoa.h>
#import "VideoItem.h"
#import "CompressionController.h"

@interface AppController : NSObject
{
	/* All the IB outlet */
	IBOutlet NSArrayController* myArrayController;
	IBOutlet CompressionController* mainCompressionController;
	IBOutlet NSTableView *myTableView;
	IBOutlet NSWindow *myWindow;
	IBOutlet NSDrawer *optionsDrawer;
	IBOutlet NSDrawer *rightDrawer;
	IBOutlet NSPopUpButton *compressFor;
	IBOutlet NSButton *addToItunes;
	IBOutlet NSButton *deleteAfterAdding;
	IBOutlet NSTextField *path;
	IBOutlet NSWindow *compressionSheet;
	IBOutlet NSWindow *mainWindow;
	IBOutlet NSMenu *fileMenu;
	
	NSArray* videoTypes; /* VideoTypes is simple array to hold the possible video types */
	NSArray* compressionTypes; // compressionTypes is a simple array to hold possible compression types
 
}

// About Panel

- (IBAction) runAboutPanel:(id)sender;

// Accessor Functions
- (NSArray *) compressionTypes;
- (void)setCompressionTypes:(NSArray *)anArray;

- (NSArray *) videoTypes;
- (void) setVideoTypes:(NSArray *)anArray;
// End Accessor Functions

// Support drag'n'drop
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:(NSTableViewDropOperation)op; 
- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info row:(int)row dropOperation:(NSTableViewDropOperation)operation;

// Main add file dialog
- (IBAction)addFile:(id)sender;
- (void) openPanelDidEnd:(NSOpenPanel*)panel returnCode:(int)rc contextInfo:(void *) ctx;
- (void) addFilesToController:(NSArray *)someFiles;


// Open drawers
- (IBAction) openDrawer:(id)sender;
- (IBAction) openRightDrawer:(id)sender;

// Main compression sequence
- (IBAction) beginCompression:(id) sender;
- (IBAction) endCompression:(id) sender;
- (void)compressionSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;

// Find destination path
- (IBAction) browseDestinationPath:(id) sender;
- (void) browseDestinationPanelDidEnd:(NSOpenPanel*)panel returnCode:(int)rc contextInfo:(void *) ctx;

// Toggle enabled for "delete after adding"
- (IBAction) addToItunesClicked: (id) sender;


@end
